package com.zhuss.common;

import java.math.BigDecimal;
import java.util.Date;

import com.zhuss.enums.CompanyType;
import com.zhuss.enums.EnumUtil;
import com.zhuss.enums.IsEnum;
import com.zhuss.enums.RequestMethod;
import com.zhuss.enums.ResourceType;
import com.zhuss.enums.RoleType;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.enums.SystemCHEnum;
import com.zhuss.enums.SystemEnum;
import com.zhuss.enums.UpperDownEnum;
import com.zhuss.util.DateUtil;
import com.zhuss.util.NoUtil;

public interface BaseVo {
	
	default String dateStrOnlyMinute(Long date) {
		return DateUtil.toDateTimeStrOnlyMinute(date);
	}
	
	default String subNo(String no) {
		return NoUtil.simpleNo(no);
	}
	
	default String resourceTypeName(Integer type) {
		return EnumUtil.containsKey(ResourceType.class, type);
	}
	
	default String systemName(Integer system) {
		return EnumUtil.containsKey(SystemEnum.class, system);
	}
	
	default String systemNameCH(Integer system) {
		return EnumUtil.containsKey(SystemCHEnum.class, system);
	}
	
	default String requestMethodName(Integer requestMethod) {
		return EnumUtil.containsKey(RequestMethod.class, requestMethod);
	}
	
	default String isName(Integer is) {
		return EnumUtil.containsKey(IsEnum.class, is);
	}
	
	default String startStopStatusName(Integer status) {
		return EnumUtil.containsKey(StartStopEnum.class, status);
	}
	
	default String roleTypeName(Integer type) {
		return EnumUtil.containsKey(RoleType.class, type);
	}
	
	default String companyTypeName(Integer companyType) {
		return EnumUtil.containsKey(CompanyType.class, companyType);
	}
	
	default String statusNameProduct(Integer status) {
		return EnumUtil.containsKey(UpperDownEnum.class, status);
	}
	
		
	default String priceName(Long price) {
		return new BigDecimal(price).divide(new BigDecimal(100l)) + "";
	}

		
	default String dateTimeSecondName(Date date) {
		String dateStr = "";
		if (date != null) {
			dateStr = DateUtil.toDateTimeSecondStr(date);
		}
		return dateStr;
	}
	
	default String dateTimeName(Date date) {
		String dateStr = "";
		if (date != null) {
			dateStr = DateUtil.toDateTimeStr(date);
		}
		return dateStr;
	}
	
}
